package com.dq.domain.sys.user;

import com.dq.vo.baseVo.VO;
import com.dq.domain.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Entity;

/**
 * @author liuhui
 * @date 2019/9/17 0017 17:23:25
 */
@Data
@Entity
@ApiModel("签到信息")
public class SignOn extends BaseEntity implements VO.ToVO {
    @ApiModelProperty("几月几号 具体时间 YYYYMMddHHmmss")
    protected String signTime;
    @ApiModelProperty("赠送积分")
    protected String integral;
    @ApiModelProperty("当天是否有额外奖励")
    protected Reward reward;
    @ApiModelProperty("额外奖励积分")
    protected String extra;

    public enum Reward{
        yes("有奖励"),
        no("无奖励");

        private String name;

        Reward(String name){
            this.name = name;
        }
    }


    @Data
    @ApiModel(value = "签到视图")
    public static class Vo implements VO {
        @ApiModelProperty("几月几号 具体时间 YYYYMMddHHmmss")
        private String signTime;

        @ApiModelProperty("赠送积分")
        private String integral;

        @ApiModelProperty("当天是否有额外奖励")
        private Reward reward;

        @ApiModelProperty("额外奖励积分")
        private String extra;
    }

    @Override
    public VO toVO(boolean isRecursion) {
        Vo vo = new Vo();
        vo.signTime = this.signTime;
        vo.integral = this.integral;
        vo.reward = this.reward;
        vo.extra = this.extra;
        return vo;
    }
}
